import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({ 
  // 别名
  resolve:{
    alias:{
      "@": path.resolve(__dirname, "src")
    }
  },
  server: {
    host: '0.0.0.0',
    port: 3000,
    // 解决跨域的问题
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        secure: false,
        rewrite: path => path.replace(/^\/api/, '')
      }
    }
  },
  plugins: [vue()]
})
